package com.zxl.baselib.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.zxl.baselib.R;

/**
 * Created by apple on 2019-08-06.
 * description:
 */
public class NoCoverLoadingDialog extends Dialog {
    private String text;

    public NoCoverLoadingDialog(@NonNull Context context) {
        super(context,R.style.loadProgressDialog);
    }

    public NoCoverLoadingDialog(@NonNull Context context, String text) {
        super(context);
        this.text = text;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setCancelable(false);
        setContentView(R.layout.no_cover_dialog);
        TextView tvText = findViewById(R.id.tv_message);
        if (!TextUtils.isEmpty(text)){
            tvText.setText(text);
        }
    }
}
